//
//  CircleImgVC.m
//  2014_IOSFramework
//
//  Created by ThomasTran on 6/11/14.
//  Copyright (c) 2014 mtoanmy. All rights reserved.
//

#import "CircleImgVC.h"

@interface CircleImgVC ()

@end

@implementation CircleImgVC

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewWillAppear:(BOOL)animated
{
    //init header
    viewHeader = [[MenuVC alloc] initWithFrame:CGRectMake(0, 0, 320, 56)];
    [self.view addSubview:viewHeader];
    
    [viewHeader setVC:self];
    
    [self displayImage];
    [self displayImageRoundCorner];
}

- (void)displayImage
{
    self.img.image = [UIImage imageNamed:@"test4.jpg"];
    self.img.layer.cornerRadius = self.img.frame.size.width / 2;
    self.img.layer.borderWidth = 3.0f;
    self.img.layer.borderColor = [UIColor whiteColor].CGColor;
    self.img.clipsToBounds = YES;
    
    [self.view addSubview:self.img];
    
//    UIImageView *myImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
//    
//    myImage.image = [UIImage imageNamed:@"no_img.jpg"];
//    
//    [self.view addSubview:myImage];
}

- (void)displayImageRoundCorner
{
    self.imgRoundCorner.image = [UIImage imageNamed:@"test4.jpg"];
//    self.imgRoundCorner.layer.cornerRadius = self.imgRoundCorner.frame.size.width / 2;
    self.imgRoundCorner.layer.borderWidth = 10.0f;
    self.imgRoundCorner.layer.borderColor = [UIColor whiteColor].CGColor;
    self.imgRoundCorner.clipsToBounds = YES;
    
    [self.view addSubview:self.imgRoundCorner];
    
    //    UIImageView *myImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
    //
    //    myImage.image = [UIImage imageNamed:@"no_img.jpg"];
    //
    //    [self.view addSubview:myImage];
}

@end
